﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    x:Class="Hangout.Client.Controls.Hangouts.HangoutList"
    mc:Ignorable="d"
    xmlns:Converters="clr-namespace:Hangout.Client.Core.Converters"
    d:DesignHeight="480" d:DesignWidth="480" Loaded="UserControl_Loaded">
	<UserControl.Resources>
        
        <Converters:PinImageSourceConverter x:Key="PinConverter"/>
        <Converters:ByAdderConverter x:Key="ByAdder"/>
        <Converters:PostedAdder x:Key="PostedAdder"/>
        
		<DataTemplate x:Key="HangoutDataTemplate">
			<Grid Width="480" >
				<TextBlock x:Name="StatusText" Text="{Binding StatusText}" Margin="17,10,8,0" TextWrapping="Wrap" d:LayoutOverrides="Height"/>
			</Grid>
		</DataTemplate>
        <Converters:DateTimeToStringConverter x:Key="DateConverter"/>
		<DataTemplate x:Key="DashboardListboxItemTemplate" >
			<Grid Width="480" d:DesignWidth="200" MinHeight="125">
				<Image HorizontalAlignment="Left" Width="75" Height="75" Source="{Binding User.ProfilePicURL}" x:Name="ProfilePicImage" Tap="ProfilePicImage_Tap" VerticalAlignment="Center"/>
				<StackPanel Margin="35,8,0,-36" Orientation="Vertical" d:LayoutOverrides="Height">
					<StackPanel Margin="57,0,16,0" Orientation="Horizontal">
						<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" FontSize="21.333" Width="323" Text="{Binding StatusText}" VerticalAlignment="Top" x:Name="ShoutText" Tap="ShoutText_Tap" Margin="0,11,0,0" />
						<Image Width="42" Margin="2,9,0,0" Height="42" HorizontalAlignment="Left" VerticalAlignment="Top" Source="{Binding IsPinned,Converter={StaticResource PinConverter}}" x:Name="PinImage" Tap="PinImage_Tap"/>
					</StackPanel>
					<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Width="388">
						<TextBlock TextWrapping="Wrap" Foreground="{StaticResource YellowBrush}" FontSize="18.667" Text="{Binding User.Name,Converter={StaticResource ByAdder}}" Margin="1,0,7,0" FontStyle="Italic" HorizontalAlignment="Right" x:Name="ProfileName" Tap="ProfileName_Tap" />
                        <TextBlock TextWrapping="Wrap" FontSize="18.667" TextAlignment="Right" Foreground="Silver" Margin="0" Text="{Binding DateTimePosted,Converter={StaticResource PostedAdder}}" HorizontalAlignment="Right" />
					</StackPanel>
				</StackPanel>
			</Grid>
		</DataTemplate>
		<DataTemplate x:Key="MoreButtonTemplate">
			<Grid>
				<Image HorizontalAlignment="Left" Height="50" VerticalAlignment="Top" Width="50" Source="/icons/appbar.download.rest.png"/>
			</Grid>
		</DataTemplate>
		<Style x:Key="RoundedButton" TargetType="Button">
			<Setter Property="Background" Value="Transparent"/>
			<Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/>
			<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
			<Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
			<Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
			<Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/>
			<Setter Property="Padding" Value="10,3,10,5"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Grid Background="Transparent">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver"/>
									<VisualState x:Name="Pressed">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneBackgroundBrush}"/>
											</ObjectAnimationUsingKeyFrames>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}"/>
											</ObjectAnimationUsingKeyFrames>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}"/>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Disabled">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
											</ObjectAnimationUsingKeyFrames>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
											</ObjectAnimationUsingKeyFrames>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
												<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Border x:Name="ButtonBackground" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="35" Margin="{StaticResource PhoneTouchTargetOverhang}">
								<ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Margin="0"/>
							</Border>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</UserControl.Resources>
    
	<UserControl.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</UserControl.FontFamily>
	<UserControl.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</UserControl.FontSize>
	<UserControl.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</UserControl.Foreground>
    
    <StackPanel x:Name="LayoutRoot">
    	<TextBlock x:Name="NoLBL" HorizontalAlignment="Right" TextWrapping="Wrap" VerticalAlignment="Top" FontFamily="Segoe WP Light" FontSize="25.333" Foreground="{StaticResource YellowBrush}" Width="464" Margin="0,13,8,0" Visibility="Collapsed" Tap="NoLBL_Tap"><Run Text="Oops, We dont have any hangouts here. "/><Run Text="Shout out" TextDecorations="Underline"/><Run Text=" a new Hangout now."/></TextBlock>
    	<ScrollViewer x:Name="ListSV">
    		<StackPanel x:Name="ItemList" Width="480">
    			<ListBox  x:Name="HangoutLB" Margin="0" ItemTemplate="{StaticResource DashboardListboxItemTemplate}" Width="480" HorizontalAlignment="Right" ScrollViewer.VerticalScrollBarVisibility="Disabled"/>
    			<ProgressBar x:Name="MorePG" Height="10" IsIndeterminate="True" Background="{StaticResource YellowBrush}" Foreground="{StaticResource YellowBrush}" Visibility="Collapsed"/>
    			<Button x:Name="MoreHangoutsBtn" Content="Button" HorizontalAlignment="Center" VerticalAlignment="Center" ContentTemplate="{StaticResource MoreButtonTemplate}" Style="{StaticResource RoundedButton}" Click="MoreHangoutsBtn_Click" Height="100" Width="100"/>
    		</StackPanel>
    	</ScrollViewer>
    </StackPanel>
</UserControl>
